package com.aigc.sclassroom.controller;

import com.aigc.sclassroom.pojo.Feedback;
import com.aigc.sclassroom.pojo.Result;
import com.aigc.sclassroom.service.FeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/feedback")
public class FeedbackController {
    @Autowired
    private FeedbackService feedbackService;

    //获取提交学生反馈表信息
    @GetMapping
    public Result<List<Feedback>> list(Long surveyId){
        List<Feedback> fs=feedbackService.list(surveyId);
        return Result.success(fs);
    }

    //学生填写反馈
    @PostMapping
    public Result add(@RequestBody Feedback feedback){
        feedbackService.add(feedback);
        return Result.success();
    }
}
